package copyengine.ui.infoTree.buildTree.builder
{
    import copyengine.infoTree.meta.CESPlaceHolderMeta;
    import copyengine.ui.display.ph.CEPlaceHolder;
    import copyengine.ui.infoTree.buildTree.InfoTreeBuildUtils;

    import flash.utils.Dictionary;

    import starling.display.DisplayObject;

    public class InfoTreeBuilderPH extends InfoTreeBuilderBasic
    {
        public function InfoTreeBuilderPH()
        {
        }

        override public function isCanHandleMeta(_meta:*):Boolean {return _meta is CESPlaceHolderMeta;}

        override public function getBuildResultMc(_meta:*, _quickFindDic:Dictionary, _quickFindKeyPR:String, _isRoot:Boolean):DisplayObject
        {
            var meta:CESPlaceHolderMeta = _meta as CESPlaceHolderMeta;
            if (meta.isBuildDisplayObject) {
                var sp:CEPlaceHolder = new CEPlaceHolder(meta);
                InfoTreeBuildUtils.setBasicInfoByMeta(meta, sp);
                InfoTreeBuildUtils.addToQuickFindDic(sp, _quickFindDic, _quickFindKeyPR, _isRoot);
                return sp;
            } else {
                InfoTreeBuildUtils.addToQuickFindDic(meta, _quickFindDic, _quickFindKeyPR, _isRoot);
                return null;
            }
        }

    }
}
